Multimedia content such as video or audio data is typically packaged in a multimedia container file to facilitate streaming and/or playback of the multimedia content by various programs. The structure and content of the multimedia container file is typically dictated by a particular multimedia container format. The multimedia container file can be used to identify and interleave different data types such as audio, video streams, subtitles, synchronization information needed to play back the multimedia content, and the like. Most digital media recording devices or systems such as cameras or camcorders typically record both multimedia content data (e.g., raw or encoded video and/or audio streams) and the corresponding multimedia container information (e.g., information describing the content data, codec parameters) as part of the recording process. The multimedia content data and the multimedia container information are typically stored at different storage locations to avoid overwrite of each other as the multimedia content data and the multimedia container information grow dynamically during the recording. For example, the multimedia container information is stored in an internal flash memory of the recording device while the multimedia content data is stored on an external storage medium such as a Secure Digital (SD) card, USB drive, hard drive disk, and the like. When the recording stops, the multimedia container information and the multimedia content data is combined or otherwise used to generate the multimedia container file suitable for streaming or playback.
When the recording stops due to abnormal events, the multimedia container file may not be generated or maybe generated improperly because the multimedia content data and the multimedia container information required for the generation of the multimedia container file, located at different locations, have not yet been properly integrated into the final multimedia container file. Such abnormal events that cause the disruption of recordings may include software or hardware failure such as a system crash, battery failure, unexpected disconnection of a storage medium, recording device, or any other critical component, and the like.
To remedy the problem of abnormal disruption of recordings, some recording devices provide mechanisms for repairing or restoring the multimedia container files that should have been generated had the recording stopped normally. Such mechanisms typically involve the generation of multimedia container files based on the existence of previously-stored multimedia content data and the multimedia container information. Existing multimedia file repair solutions have numerous limitations. For example, existing technologies cannot be used to repair multimedia files if the multimedia container information is inaccessible or unavailable. The multimedia container information may be inaccessible due to malfunction or corruption of the internal storage of the recording device, for example. Additionally, the multimedia container information may be overwritten or erased before it is used to construct the multimedia container file. For example, a new SD card may be inserted into the recording device in place of an old SD card that was used to record the content data before the abnormal event. In this case, the new SD card would not have the multimedia content data previously stored in the old SD card and therefore cannot be used to restore the multimedia container file with the container information left in the internal storage of the recording device. Furthermore, the container information that is left in the internal storage of the recording device may become erased or overwritten with the recording of new media content, making it impossible to later restore the old multimedia container file.
One approach to solve this problem involves preserving the old multimedia container information in the internal storage of the recording device indefinitely until the corresponding multimedia content data is available again for the generation of the multimedia container file (e.g., when the old SD card containing the old multimedia content data is connected again to the recording device). The drawback is that a potentially large amount of storage space may be taken up for an indefinite period of time in the internal storage of the recording device, which typically has a relatively small storage capacity to start with. Accordingly, there is a need for improved methods and apparatus for repair and restoration of multimedia files without significant space overhead.